package com.ruoyi.project.business.publicholiday.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.model.AjaxResult;
import com.ruoyi.project.business.publicholiday.request.ListOfMonthRequest;
import com.ruoyi.project.business.publicholiday.response.HolidayResponse;
import com.ruoyi.project.business.publicholiday.service.IHolidayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * 月排班Controller
 * 
 * @author ${author}
 * @date 2024-02-05
 */
@RestController
@RequestMapping("/business/holiday")
public class HolidayController extends BaseController {
    @Autowired
    private IHolidayService holidayService;

    /**
     * 一个月中的假日类型 及 索引
     * @param request
     * @return
     */
    @GetMapping("/list-of-month")
    public AjaxResult listOfMonth(ListOfMonthRequest request) {
        Date yearMonth = request.getYearMonth();
        HolidayResponse response = holidayService.listOfMonth(yearMonth);
        return AjaxResult.success(response);
    }

}
